<!--
 * @FilePath     : /study_code/layui/15-14.html
 * @Description  : filterDone 搜索完成时的回调
 * @Date         : 2025-04-09 15:50:51
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-09 16:10:35
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="demo1" class="xm-select-demo"></div>

    <script src="/xm-select/dist/xm-select.js"></script>
    <script>
      var demo1 = xmSelect.render({
        el: '.xm-select-demo',
        data: [
          { name: '张三', value: 1 },
          { name: '李四', value: 2 },
          { name: '王五', value: 3 },
        ],

        //
        filterable: true,
        filterDone: function (val, list) {
          console.log(1, '当前搜索值', val) // '四'
          console.log(2, '过滤后的数据', list)
          /*
          [
            {
              name: '李四',
              value: 2,
              __node: { level: 0, loading: undefined; parent: null }
            },
            ... // 若有多个数据，这下面还有记录
          ]
          */
        },
      })
    </script>
  </body>
</html>
